#include <iostream>
using namespace std;

class Student{
    private:
        string name;
        int *age;
    public:
        Student(){
            cout << "无参构造函数" << endl;
        }
        Student(string n, int a):name(n), age(new int(a)){
            cout << "有参构造函数" << endl;
        }
        void show(){
            cout << name << " " << *age << endl;
        }
};

int main(int argc, const char *argv[]){
    Student s1("zhangsan", 18); // 调用有参构造
    s1.show(); // zhangsan  18
    return 0;
}